package com.pmenergy.view;


import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;

import org.primefaces.model.DefaultTreeNode;
import org.primefaces.model.TreeNode;

import com.pmenergy.util.DisciplineNode;
 
@ManagedBean
@ApplicationScoped
public class DisciplineServiceBean {
     
    public TreeNode createDisciplineNodes() {
        TreeNode root = new DefaultTreeNode(new DisciplineNode("Files", "Folder"), null);
         
        TreeNode DisciplineNodes = new DefaultTreeNode(new DisciplineNode("DisciplineNodes", "Folder"), root);
        TreeNode pictures = new DefaultTreeNode(new DisciplineNode("Pictures", "Folder"), root);
        TreeNode movies = new DefaultTreeNode(new DisciplineNode("Movies", "Folder"), root);
         
        TreeNode work = new DefaultTreeNode(new DisciplineNode("Work", "Folder"), DisciplineNodes);
        TreeNode primefaces = new DefaultTreeNode(new DisciplineNode("PrimeFaces", "Folder"), DisciplineNodes);
         
        //DisciplineNodes
        TreeNode expenses = new DefaultTreeNode("DisciplineNode", new DisciplineNode("Expenses.doc", "Word DisciplineNode"), work);
        TreeNode resume = new DefaultTreeNode("DisciplineNode", new DisciplineNode("Resume.doc", "Word DisciplineNode"), work);
        TreeNode refdoc = new DefaultTreeNode("DisciplineNode", new DisciplineNode("RefDoc.pages", "Pages DisciplineNode"), primefaces);
         
        //Pictures
        TreeNode barca = new DefaultTreeNode("picture", new DisciplineNode("barcelona.jpg", "JPEG Image"), pictures);
        TreeNode primelogo = new DefaultTreeNode("picture", new DisciplineNode("logo.jpg", "JPEG Image"), pictures);
        TreeNode optimus = new DefaultTreeNode("picture", new DisciplineNode("optimusprime.png", "PNG Image"), pictures);
         
        //Movies
        TreeNode pacino = new DefaultTreeNode(new DisciplineNode("Al Pacino", "Folder"), movies);
        TreeNode deniro = new DefaultTreeNode(new DisciplineNode("Robert De Niro", "Folder"), movies);
         
        TreeNode scarface = new DefaultTreeNode("mp3", new DisciplineNode("Scarface", "Movie File"), pacino);
        TreeNode carlitosWay = new DefaultTreeNode("mp3", new DisciplineNode("Carlitos' Way", "Movie File"), pacino);
         
        TreeNode goodfellas = new DefaultTreeNode("mp3", new DisciplineNode("Goodfellas", "Movie File"), deniro);
        TreeNode untouchables = new DefaultTreeNode("mp3", new DisciplineNode("Untouchables", "Movie File"), deniro);
         
        return root;
    }
}